home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Modeling the Dream
/
Modeling the Dream CD - Walkthroughs and Flybys II (1994)(Waite Group).iso
/
spacebar
/
chess.txt
< prev
next >
Wrap
Text File
|
1994-09-14
|
10KB
|
602 lines
set maxcall on
set swappath "c:\temp"
init
localise
chess
terminate
chess: ;-------- start chess ------------
midpak volume 80
local leadingzero "0"
local flic "" ;the current flic
local fil 0 ;array to hold filename
local buf 0 ;array to hold buffer name
local fra 0 ;array to hold frame to play
local total 0 ;number of elements in array
local numlad 0 ;number of sound files to load
local lad 1 ;array for files to load
local numflics 44 ;number of flics in sequence
local k "a"
global playspeed 4
global thispath "\\flics\\mulholla\\"
runmode ;check in from CD or hard disk
databegin chesstable
gtop: ;build arrays
set "fil"$@total @ ;the flic file
set "buf"$@total @ ;the sound effect
set "fra"$@total @ ;frame to play it
set total @total+1 ;increment counter for num of rows
if !(@=="end") ;read until end encountered
dataskip -1
goto gtop ;jump back
endif
mp chess ;start midi music
databegin chesstable ;open table and grab first record
set fl @
set bf @
set fr @
mark @numflics ;start main loop
set flic @loop-1 ;store current flic name
;start of block locate sfx per flic
set numlad 0 ;reset number of effects for flic=0
mark @total ;once through for each row of table
if @("fil"$@loop-1)==@flic ;is there an sfx for current file on
;this row?
set tmpbuf @("buf"$@loop-1) ;Yes so store name of effect
set flag 0 ;assume sfx has not already been tagged
if @numlad>0 ;have any sfxs been found for this flic
mark @numlad ;they have so run list again
if @tmpbuf==@("lad"$@loop) ;look for this sfx against ones found
set flag 1 ;this sfx already in array lad
endif
loop
if !@flag ;sfx was found that is not in array lad
set numlad @numlad+1 ;increment total to load
set "lad"$@numlad @tmpbuf ;add sfx as new indice
endif
else ;sfx found with lad total=0
set numlad 1 ;there is one now
set lad1 @tmpbuf ;set first element in array
endif
endif
loop
if @numlad>0 ;list of sfxes for flic in lad
window
mark @numlad
load @c$"\\bigdemo\\"$@("lad"$@loop)$".raw"
unlock @("lad"$@loop)
loop
endif
if @loop<11 ;do we need to pad the file name
set leadingzero "0" ;with a 0?
else
set leadingzero ""
endif
dload @drive@thispath$"chess"$@leadingzero$(@loop-1)$".fli" d1 1
putdff d1 0 0 0
mark (d1->frames)-1 ;play flic by frames
putdff d1 @playspeed @loop @loop
if @loop-1==@fr&&@fl==@flic
digpak preloaded @@bf
digpak play
set fl @
set bf @
set fr @
endif
waitkey 0 ;flush keyboard buffer
getkey k name ;check for a key
if @k==return
break terminate
endif
loop
ahead:
dfree d1
waitkey 40 ;half second delay at end of ea flic
;so can hear sfx
digpak stop ;stop digpak before unloading
if @numlad>0 ;list of sfxes for flic in lad
window
mark @numlad
free @("lad"$@loop)$".raw"
loop
endif
loop
chessout:
dfree d1
goto terminate
return ;----------end chess ---------
init:
video l
global cr chr(10)$chr(13)
global ext ""
local trip 1 ;does the sound play?, set to false
. chdir(@c$"\\bigdemo")
opengl @c$"\bigdemo\bigdemo.ovr"
load midpak
@midpak verify
closegl
if !@0
text "The MIDPAK.COM driver is not loaded!"$@cr
text "Press any key to return to DOS."
wait
exit
endif
if !envdef(c)
text "No C environment variable! "@cr
text "To run BIGDEMO from DOS use GO.BAT"@cr
wait
exit
endif
when ESC goto terminate
set fs open(@t$"\mtd\midpak.adv") ;How big is MIDPAK.ADV
local advsize size(@fs) ;stick it in ADVSIZE
. close(@fs)
databegin ;sizes of the wave drivers
"44836"
"10590"
"10816"
"10590"
"7178"
"10590 "
"39859"
"end"
dataend
local x @ ;grab first item into var
advhop:
if @x!="end"
if @x==@advsize
text "Using wave table synthesis for MIDI"@cr
set ext ".gen"
goto advdone
else
local x @
goto advhop
endif
endif
text "Using frequency modulation (FM) MIDI files"@cr
set ext ".opl"
advdone:
opengl @c$"\bigdemo\bigdemo.ovr"
load midpak.grp digpak.grp ;load grps
closegl
if !@0
text "Error loading GRP files"
wait
exit
else
text "GRPs loaded..."$@cr
endif
. chdir(@c$"\\bigdemo")
load "_laser.raw"
digpak preloaded @_laser
digpak play
tt:
digpak done
if !@0
set trip 0
goto tt
endif
free laser
if @trip
text "Sound didn't play!!!!"@cr
wait
exit
else
text "Sound appears to be playing correctly"@cr
endif
midpak volume 100 ;MIDPAK driver has internal vol control
;mixer levels for MIDI!!!
text "Press Enter to start now"@cr@cr@cr
text "At runtime pressing Enter will advance"@cr@cr@cr
text "Press Esc at anytime to terminate"@cr@cr@cr
text "Pausing for 10 seconds"
flushkey
mark 10
wait 100
text "."
waitkey 0
getkey k name
if @k==return
return
endif
loop
return ;--------------- end of init
localise: ;subroutine checks for flics on hd
;and copies them if possible.
local ax 0 bx 0 cx 0 freebytes 0 chcnt 0 chfile " " downed 0
local runcd 0
. chdir(@t$"\\mtdtemp")
global fromcd 0
int 0x21 0x3600,,,0x0000 ;default drive
if @ax==0xffff
text "Problem getting free disk space"
pause
exitnow
endif
set freebytes (@ax*@bx*@cx)/1000
if @freebytes>=30000
set enuf 0
else
set enuf 1
endif
color 0
clearscr
color 15
window
databegin ckl
loctop:
. chdir(@t$"\\mtdtemp")
set chfile @
if @chfile<>"end"
local temp open(@chfile)
if @temp
local success close(@temp)
else
; text @chfile$": file not found"$@cr
set downed 1
endif
goto loctop
endif
. chdir(@t$"\\mtd")
if @downed==0
text 0 0 "The requisite file have been found in MTDTEMP"
waitkey 100
set fromcd 1
global drive @t
return
endif
if @downed==1&&@enuf==0
databegin
"You have more than 30MB free on this drive!
Press C if you would like to run the MIDPAK BigDemo from the CD, or
Press D to download the graphics to your hard disk for faster playback.
Please press either C or D now:"
dataend
window
color 0
clearscr
color 15
text @
flushkey
waitkey
getkey k
if @k=="d"||"D"
set fromcd 1
set drive @t
download ;go get the files...
return
endif
if @k=="c"||"C"
global drive @c
. chdir(@drive$"\\bigdemo")
return ;play as per normal
endif
endif
if @enuf==1&&@downed==1
global drive @c
. chdir(@drive$"\\bigdemo")
return ;play as per normal
endif
return
runmode:
if @fromcd==1
set thispath "\\mtdtemp\\"
endif
return
mp:
midpak use @c$"\\bigdemo\\"$@1$@ext
midpak play
return
playit:
dload @1 d1 1
putdff d1 0 0 0
mark (d1->frames)-1
putdff d1 @playspeed @loop @loop
waitkey 0
getkey k name
if @k==return
set broken 1
break playout
endif
loop
playout:
dfree d1
return
terminate:
when esc
digpak quit ;implicit loading
midpak stop
free digpak midpak
. chdir(@c$"\\spacebar")
exitnow
download:
video m
color 0
window
clearscr
color 15
exec c:\dos\xcopy.exe @c$"\\flics\\russam\*.fli "$@t$"\\mtdtemp"
video l
return
ckl:
CHESS00.FLI
CHESS01.FLI
CHESS02.FLI
CHESS03.FLI
CHESS04.FLI
CHESS05.FLI
CHESS06.FLI
CHESS07.FLI
CHESS08.FLI
CHESS09.FLI
CHESS10.FLI
CHESS11.FLI
CHESS12.FLI
CHESS13.FLI
CHESS14.FLI
CHESS15.FLI
CHESS16.FLI
CHESS17.FLI
CHESS18.FLI
CHESS19.FLI
CHESS20.FLI
CHESS21.FLI
CHESS22.FLI
CHESS23.FLI
CHESS24.FLI
CHESS25.FLI
CHESS26.FLI
CHESS27.FLI
CHESS28.FLI
CHESS29.FLI
CHESS30.FLI
CHESS31.FLI
CHESS32.FLI
CHESS33.FLI
CHESS34.FLI
CHESS35.FLI
CHESS36.FLI
CHESS37.FLI
CHESS38.FLI
CHESS39.FLI
CHESS40.FLI
CHESS41.FLI
CHESS42.FLI
CHESS43.FLI
CHESS44.FLI
end
chesstable:
0,_C1,31
1,_C2,81
2,_C3,1
2,_C3,99
2,_C4,126
2,_C4,161
2,_C4,192
2,_C4,223
2,_C4,254
2,_C4,280
4,_C5,28
4,_C5,58
4,_C5,88
4,_C5,118
4,_C5,148
5,_C6,72
6,_C7,44
6,_C7,57
6,_C8,67
6,_C6,117
7,_C9,36
7,_C9,44
7,_C9,54
7,_C9,61
7,_C9,67
8,_C8,32
8,_C7,61
8,_C7,74
8,_C7,88
8,_C8,91
8,_C6,137
9,_C11,34
9,_C12,66
9,_C6,113
10,_C7,48
10,_C7,64
10,_C13,72
10,_C6,133
11,_C14,31
11,_C15,37
11,_C16,47
11,_C17,56
11,_C6,112
12,_C18,41
12,_C18,47
12,_C18,57
12,_C18,63
12,_C18,66
12,_C6,109
13,_C15,32
13,_C19,40
13,_C20,50
13,_C11,65
13,_C12,96
13,_C12,101
14,_C21,30
14,_C7,47
14,_C7,57
14,_C7,67
14,_C21,75
14,_C6,124
15,_C17,32
15,_C6,123
16,_C15,32
16,_C23,45
16,_C12,90
16,_C6,143
17,_C24,32
17,_C21,56
17,_C25,65
17,_C6,122
18,_c26,32
18,_c26b,42
18,_c27,67
18,_c6,122
19,_c28,32
19,_c29,73
19,_c6,136
20,_c30,42
20,_c30,61
20,_c30,81
20,_c30,101
20,_c31,111
20,_c30,156
20,_c30,162
20,_c6,202
21,_c28,32
21,_c32,49
21,_c33,63
21,_c29,81
21,_c6,122
22,_c30,51
22,_c30,61
22,_c34,85
22,_c6,165
23,_c28,32
23,_c35,73
23,_c36,81
23,_c38,136
23,_c6,196
24,_c39,32
24,_c40,73
24,_c6,134
25,_c28,32
25,_c41,51
25,_c6,132
26,_c30,51
26,_c30,72
26,_c42,82
26,_c43,102
26,_c30,137
26,_c6,178
27,_c38,32
27,_c29,106
27,_c6,147
28,_c45,44
28,_c6,104
29,_c47,29
29,_c48,54
29,_c49,82
29,_c6,139
30,_c30,51
30,_c50,70
30,_c51,111
30,_c30,131
30,_c6,172
31,_c52,32
31,_c53,58
31,_c53,70
31,_c53,82
31,_c52,95
31,_c6,152
32,_c54,41
32,_c54,51
32,_c54,61
32,_c54,71
32,_c54,76
32,_c6,116
33,_c55,32
33,_c6,147
34,_c39,32
34,_c56,50
34,_c56,60
34,_c56,70
34,_c39,83
34,_c57,102
34,_c6,143
35,_c28,32
35,_c29,91
35,_c6,132
36,_c58,32
36,_c59,40
36,_c60,48
36,_c57,79
36,_c6,120
37,_c58,32
37,_c58,71
37,_c58,91
37,_c58,101
37,_c6,144
38,_c58,32
38,_c59,40
38,_c61,48
38,_c6,132
39,_c62,22
39,_c6,101
40,_c56,43
40,_c56,60
40,_c39,90
40,_c62,32
40,_c6,142
41,_c62,32
41,_c63,51
41,_c64,61
41,_c6,113
42,_c56,30
42,_c65,52
42,_c57,71
42,_c6,113
44,_c67,32
44,_c59,49
44,_c57,68
end